DEVICE ABSCNT

1. Introduction

The internal ABSCNT device manages the acquisition and manipulation of the position from absolute sensors. These sensors are typically absolute encoders with different types of output interface (parallel, SSI, etc.) The main features of the device are:

2. Declaration

For use the device you must declare it in the INTDEVICE section of the unit configuration.

;--------------------------------- 
; Internal devices Declaration
;--------------------------------- 
INTDEVICE 
...
<nome>  ABSCNT  TCamp  IAbsCont  ICont

Dove:

Field name Description Example Note
<nome> Device name Axe -
ANPOS2 Keyword that identifies the device ABSCNT - -
TCamp Device sampling time in milliseconds 4 -
IAbsCont Absolute counter number (Verify the HW documentation
of the product for the correct value to set)
1
ICont Incremental counter address generated by the device (always 1.CNTx) 1.CNT01 If entering the value X. X field is ignored
:important:All fields of the Declaration are mandatory and must be present on the same line. Set “X.X” or “X” if a resource is not available or cannot be used. Disable a resource means disable all functionality of the devices that use it.

3. Operation

Operation of the device is illustrated with the following diagram:

3.1 Communication configuration

The “Communication configuration” block Configure Protocol blocks appropriately in accordance with the number of bits to be captured, with the number of bits to “discard”, with the capture mode, etc.

3.2 SSI protocol interface

The “SSI protocol interface” block executes the acquisition of data from a transducer with SSI protocol. The read data should then be manipulated to get information by absolute position.

3.3 Communication error control

The “Communication error control” block does the control of the “quality” of data acquired by the transducer. Controls can be equal and/or, for transducers that require it, the verification of certain bits of error present in the frame.

3.4 Speed checking

The “Speed checking” block check the rotational speed in RPM compared to the maximum and shall report any overshoot. His task is to detect errors in the acquisition of the data.

3.5 Reversing

The “Reversing” block manages the reversal of direction of rotation that causes the increase in location determined byst_cntdir.

3.6 Module

The “Module” block manipulates the position acquired and subtracts the offset to bring it back within the range 0÷(pulserev x revnum) quando signenab be worth 0 and within the range -(pulserev x revnum)/2 ÷ (pulserev x revnum)/2 when signenab be worth 1.

3.7 Position conversion

The “Position conversion” block converts from value bits position at value position in units of measurement. The data obtained (posit) can have decimal or sexagesimal representation depending on the setting parameter posittype.

4. Notes on the device operation

5. Parameters list

5.1 prot

Short description Protocol type
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷0
Parameter ID -
Write conditions st_updenab = 0

Description:

Defines the protocol type used for acquisition of position transducer:

0= SSI


5.2 framebits

Short description SSI Bits frame number
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷63
Parameter ID -
Write conditions st_updenab = 0

Description:

Is the total number of bits that make up the SSI frame.


5.3 leadingbits

Short description Non-significant bits in the SSI frame number
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷15
Parameter ID -
Write conditions st_updenab = 0

Description:

It is the number of bits, starting from the MSbit, which are meaningless for the reconstruction of the given by the transducer.


5.4 trailingbits

Short description The frame number insignificant SSI frame queued
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷15
Parameter ID -
Write conditions st_updenab = 0

Description:

It is the number of bits, starting from the LSbit, which are meaningless for the reconstruction of the given position from the transducer.


5.5 codetype

Short description Data code
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷1
Parameter ID -
Write conditions st_updenab = 0

Description:

It is the type of encoding of the data acquired by the position transducer:

0: Binary code
1: Gray code


5.6 datalogic

Short description Logical data type
Dimension Byte
Default value Ritentive
Access type Read
Unit measure -
Valid range 0÷1
Parameter ID -
Write conditions st_updenab = 0

Description:

Indicates the type of data captured by the transducer position:

0: normal
1: inverse


5.7 par

Short description Parity check
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷2
Parameter ID -
Write conditions st_updenab = 0

Description:

Indicates the type of parity check on SSI data:

0: disable
1: odd parity
2: even parity


5.8 parbitpos

Short description Bit position equal
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷31
Parameter ID -
Write conditions st_updenab = 0

Description:

Location of parity within the frame. This parameter is meaningful only if par > 0.


5.9 err1pos

Short description Bit position error 1
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷31
Parameter ID -
Write conditions st_updenab = 0

Description:

Bit position 1 error within the frame. Parameter that is currently not implemented.


5.10 err2pos

Short description Bit position error 2
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷31
Parameter ID -
Write conditions st_updenab = 0

Description:

Bit position 1 error within the frame. Parameter that is currently not implemented.


5.11 updatemode

Short description Scan mode data
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷1
Parameter ID -
Write conditions st_updenab = 0

Description:

It is the temporal mode of acquisition of the transducer data:

0: each sample time device ABSCNT
1: continuous


5.12 clockrate

Short description Clock frequency used from the SSI protocol
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷3
Parameter ID -
Write conditions st_updenab = 0

Description:

Select the clock frequency used in SSI protocol:

0: 1MHz
1: 500KHz
2: 250KHz
3: 125KHz


5.13 monofloptime

Short description Monoflop time
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure uS (microseconds)
Valid range 0÷127
Parameter ID -
Write conditions st_updenab = 0

Description:

Indicates the time in monoflop microseconds. This is the time that waits between two acquisitions with SSI protocol, when updating the data is continuous(updatemode = 1). The set value will be rounded up to a multiple of the period of clock frequency (inverse of clockrate). If the value set is not obtainable from the device because they are too big and reports a warning.


5.14 pulserev

Short description Number of positions per revolution
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷999999
Parameter ID -
Write conditions st_updenab = 0

Description:

Number of positions per revolution of the transducer (plate data).


5.15 revnum

Short description Number of turn
Dimension Word
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷999999
Parameter ID -
Write conditions st_updenab = 0

Description:

It is managed by the transducer speed shown on the rating plate data. The value is significant when using multi transducers, for the transducers singleturn set the value 1.


5.16 signenab

Short description Sign enabling
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷1
Parameter ID -
Write conditions st_updenab = 0

Description:

Enables the interpretation of data acquired from the transducer with sign.

0: only positive position
1: positive and negative position


5.17 posittype

Short description Representation posit parameter type
Dimension Byte
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 0÷1
Parameter ID -
Write conditions st_updenab = 0

Description:

Defines the representation type of the value of the parameter position posit:

0: decimal
1: sexagesimal (degrees and minutes)


5.18 measure

Short description Reference measure for the position factor calculating
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure Um
Valid range 1÷999999
Parameter ID -
Write conditions

Description:

Indicates the space, in units of measurement, routes to get primary impulses set in pulse parameter. This parameter is used to calculate the conversion factor between primary impulses and units.

posit = (encoder ⋅ measure) / pulse

The ratio measure/pulse must be a value between 0.00935 and 1.


5.19 pulse

Short description Number of impulses for calculating the position factor
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range 1÷999999
Parameter ID -
Write conditions -

Description:

Indicates the number of pulses (1 encoder pulse = 4 primary pulses) that will generate the transducer in both directions to get a movement of measure. This parameter is used to calculate the conversion factor between primary impulses and units.

posit = (encoder · measure) / pulse

The ratio measure/pulse must be a value between 0.00935 and 1.


5.20 maxvel

Short description Maximum speed
Dimension Word
Default value Ritentive
Access type Read - Write
Unit measure RPM
Valid range 0÷32767
Parameter ID -
Write conditions st_updenab = 0

Description:

Indicates the maximum speed expressed in revolutions per minute (RPM) where to ride is the position value in units corresponding to the impulses that are defined in pulserev. This parameter is used to control the quality of the value acquired by the transducer; basically the device check that between two consecutive values obtained there is a change in position “consistent” with the speed and that this variation does not exceed that which would be achieved when the transducer rotates the value set on the parameter. Setting value 0 disables the control.


5.21 encoder

Short description Bit absolute position value
Dimension Long
Default value 0
Access type Read - Write
Unit measure -
Valid range -
Parameter ID -
Write conditions -

Description:

It is the bits value ( encoder positions) of the transducer absolute position. The value assumed by this parameter starts from 0 to(pulserev · revnum) when signenab be worth 0 and it goes -(pulserev· revnum)/2 to (pulserev · revnum)/2 when signenab be worth 1.


5.22 posit

Short description UM value in absolute position
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure Um
Valid range
Parameter ID
Write conditions -

Description:

It's the value expressed in units of absolute position of transducer. Is obtained by the following formula: encoder · measure / pulse.


5.23 par01

Short description 01 parameter
Dimension Long
Default value 0
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Parameter 01. Not used, reserved for other use.


5.24 par02

Short description 02 parameter
Dimension Long
Default value 0
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Parameter 02. Not used, reserved for other use.


5.25 par03

Short description 03 parameter
Dimension Long
Default value 0
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Parameter 03. Not used, reserved for other use.


5.26 par04

Short description 04 parameter
Dimension Long
Default value 0
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Parameter 04. Not used, reserved for other use.


5.27 ret01

Short description retentive parameter 01
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Retentive 01 parameter. Not used, reserved for other use.


5.28 ret02

Short description retentive parameter 02
Dimension Long
Default value Ritentive
Access type Read - Write
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Retentive 02 parameter. Not used, reserved for other use.


5.29 errcode

Short description Identification code of the error.
Dimension Byte
Default value 0
Access type Read
Unit measure -
Valid range -
Parameter ID -
Write conditions -

Description:

Indicates the type of error detected by the device. For more information see the section.


5.30 errvalue

Short description Identifying the cause of the error code
Dimension Byte
Default value 0
Access type Read
Unit measure -
Valid range -
Parameter ID -
Write conditions -

Description:

Indicates the type of the error detected by the device. For more information see the section.


5.31 wrncode

Short description Code warning identification
Dimension Byte
Default value 0
Access type Read
Unit measure -
Valid range
Parameter ID -
Write conditions -

Description:

Indicates the type of warning reported by device. For more information see the section.


5.32 wrnvalue

Short description Identification code of the cause of the warning
Dimension Byte
Default value 0
Access type Read
Unit measure -
Valid range -
Parameter ID
Write conditions -

Description:

Indicates the cause of the warning reported by device. For more information see the section.


6. State lists

6.1 st_updenab

Short description Enabling status update
Default value 0
Status ID -

Description

Indicates that the acquisition of the data by the transducer is activated and adjusted by the parameter updatemode.

0 = acquisition disabled.
1 = acquisition enabled.


6.2 st_cntrev

Breve descrizione Stato di direzione antioraria per l'incremento del conteggio.
Valore di default Ritentivo
ID stato -

Descrizione:

Indica la direzione di rotazione che causa l'incremento del conteggio.

0 = orario.
1 = antiorario.


6.3 st_warning

Breve descrizione Presenza di un warning.
Valore di default 0
ID stato -

Descrizione:

Indica lo stato di warning del device, per riconoscere il tipo di warning si deve fare riferimento alle variabili wrncode e wrnvalue.

0 = warning non presente.
1 = warning presente.


6.4 st_error

Breve descrizione Presenza di un errore.
Valore di default 0
ID stato

Descrizione:

Indica lo stato di errore del device, per riconoscere il tipo di errore si deve far riferimento alle variabili errcode e errvalue.

0 = errore non presente.
1 = errore presente.


6.5 st_01

Breve descrizione Stato Stato 1 generico
Valore di default 0
ID stato -

Descrizione:

Stato disponibile per future implementazioni.


6.6 st_02

Breve descrizione Stato Stato 2 generico
Valore di default 0
ID stato -

Descrizione:

Stato disponibile per future implementazioni.


6.7 st_03

Breve descrizione Stato Stato 3 generico
Valore di default 0
ID stato -

Descrizione:

Stato disponibile per future implementazioni.


6.8 st_04

Breve descrizione Stato Stato 4 generico
Valore di default 0
ID stato -

Descrizione:

Stato disponibile per future implementazioni.


7. Elenco Comandi

7.1 UPDENAB

Breve descrizione Abilitazione aggiornamento conteggio.
Condizione st_updenab = 0
ID comando -

Descrizione:

Abilita l'acquisizione del dato di posizione dal trasduttore in accordo con il parametro updatemode.


7.2 UPDDISAB

Breve descrizione Disabilitazione aggiornamento conteggio.
Condizione st_updenab = 1
ID comando -

Descrizione:

Disabilita l'acquisizione del dato di posizione dal trasduttore.Con l'aggiornamento disabilitato è possibile modificare i parametri di comunicazione.


7.3 CNTREV

Breve descrizione Direzione incremento conteggio antiorario.
Condizione st_updenab = 0
ID comando -

Descrizione:

Imposta la direzione di incremento del conteggio ad antiorario.


7.4 CNTDIR

Breve descrizione Direzione incremento conteggio orario.
Condizione st_updenab = 0
ID comando -

Descrizione:

Imposta la direzione di incremento del conteggio ad orario.


7.5 RSERR

Breve descrizione Reset dello stato di errore.
Condizione st_error = 1
ID comando -

Descrizione:

Azzera lo stato di errore (st_error) nel caso non sia più presente la condizione di errore.


7.6 RSWRN

Breve descrizione Reset dello stato di warning.
Condizione st_warning = 1
ID comando -

Descrizione:

Azzera lo stato st_warning.


7.7 CMD01

Breve descrizione Comando generico 1.
Condizione -
ID comando -

Descrizione:

Comando disponibile per future implementazioni.


7.8 CMD02

Breve descrizione Comando generico 2.
Condizione -
ID comando -

Descrizione:

Comando disponibile per future implementazioni.


7.9 CMD03

Breve descrizione Comando generico 3.
Condizione -
ID comando -

Descrizione:

Comando disponibile per future implementazioni.


7.10 CMD04

Breve descrizione Comando generico 4.
Condizione -
ID comando -

Descrizione:

Comando disponibile per future implementazioni.


8. Errori e Warnings

8.1 Errors

Quando il device non riesce ad eseguire le operazioni derivanti da una non corretta programmazione da parte dell'utente segnala questa condizione tramite l'attivazione dello stato st_error. Il device, inoltre, rende disponibili, tramite i valori sui parametri errcode ed errvalue, alcune informazioni per meglio comprendere il tipo di errore e quale condizione l'ha generato. Tali informazioni e lo stato di errore st_error, permangono finché non viene eseguito l'apposito comando RSERR che li cancella.
La seguente tabella specifica i valori assunti da errcode:

errcode Descrizione
0Nessun errore.
1Errore generico
2Errore hardware: l'hardware non supporta dispositivi di conteggio assoluto.

Per mezzo del parametro errvalue è possibile ottenere informazioni più dettagliate riguardo l'errore.
Attualmente il parametro errvalue non è utilizzato e vale sempre 0.

8.2 Warnings

Quando l'impostazione di un parametro del device non viene accettata o quando non è possibile eseguire un comando il device segnala questa condizione tramite l'attivazione dello stato st_warning. Il device, inoltre, rende disponibili, tramite i valori sui parametri wrncode e wrnvalue, alcune informazioni per meglio comprendere il tipo di warning e quale condizione l'ha generato. Tali informazioni e lo stato di warning st_warning, permangono finché non viene eseguito l'apposito comando RSWRN che li cancella.
La seguente tabella specifica i valori assunti da wrncode:

wrncode Descrizione
0Nessun warning.
1parametro non accettato: la scrittura su un parametro non è andata a buon fine.
2comando non eseguito.
3velocità troppo alta.
4errore di parità.

Per mezzo del parametro wrnvalue è possibile ottenere informazioni più dettagliate riguardo il warning.

wrnvalue Descrizione
0nessuna informazione aggiuntiva riguardo il warning.
1operazione non abilitata.
2dato fuori range.